// import React from 'react';
import React, { Suspense, lazy } from 'react';


// import { BrowserRouter as Router, Route, Switch, Link } from 'react-router-dom';
import { HashRouter as Router, Route, Switch, Link } from 'react-router-dom';

// import Login from './pages/Login';
// import Home from './pages/Home';

const Login = lazy(() => import('./pages/Login'));
const Home = lazy(() => import('./pages/Home'));

//loginMask 选直接到index.html写一下样式哈

const AppRouter = () => (
    <Router>

        <Suspense fallback={<div className="loginMask">正在拼命加载...</div>}>
            <ul className="top_header">
                <li><Link to="/Login">登陆</Link></li>
                <li><Link to="/Home">首页</Link></li>
            </ul>
            <Switch>
                <Route exact path="/Login" component={Login} />
                <Route path="/" component={Home} />
            </Switch>
        </Suspense>
    </Router>
);

export default AppRouter;